package com.ytclub.subject.common.enums;

import lombok.Getter;

/**
 * 题目点赞状态枚举类
 *
 * @author: HuangQi
 * @date: Created in 7:52 2024/4/24
 * @description: 题目点赞状态枚举
 */
@Getter
public enum SubjectLikedStatusEnum {
    LIKED(1,"点赞"),

    UNLIKE(0,"取消点赞");

    public int code;

    public String desc;

    SubjectLikedStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectLikedStatusEnum getByCode(int codeVal) {
        for (SubjectLikedStatusEnum subjectLikedStatusEnum : SubjectLikedStatusEnum.values()) {
            if (subjectLikedStatusEnum.code == codeVal) {
                return subjectLikedStatusEnum;
            }
        }
        return null;
    }
}
